<%@ page language="java" contentType="text/html; charset=UTF-8"
         pageEncoding="UTF-8" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@taglib prefix="shiro" uri="http://shiro.apache.org/tags" %>
<%
    request.setCharacterEncoding("UTF-8");
    String htmlData = request.getParameter("content1") != null ? request.getParameter("content1") : "";
%>
<%
    String path = request.getContextPath();
    String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort()
            + path + "/";
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<%@ include file="/WEB-INF/JSP/backHome/modalWindows/StudentsListPage.jsp" %>
<html>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <title>Insert title here</title>
    <script type="text/javascript" src="<%=path%>/My97DatePicker/WdatePicker.js"></script>
    <script type="text/javascript" src="<%=path%>/HoganJS/handlebars-v4.0.11.js"></script>
    <link rel="stylesheet" type="text/css" href="<%=path%>/CSS/bombBox.css">
    <link rel="stylesheet" type="text/css" href="<%=path%>/CSS/backLayout.css">
    <style type="text/css">
        input {
    	width: 230px;
		}
    </style>
</head>
<body style="background: #f5f5f5">
<div class="main">
    <div class="weizhi">
        考试管理>>科目二编号>>修改
    </div>
    <div class="div_body" style="box-shadow: 0 0 5px #cccccc;">
        <div id="modal-overlay">

        </div>
        <div class="div_form">
            <form action="<%=path%>/DrivingSys/updateSubjectTwoNo"  class="form" method="post" onsubmit="return check()">
                <input id="fid" type="text" name="fid" style="visibility:hidden" value="${subjectTwoNo.fid}"/>
                <div class="jczl">
                 <div class="div_input_hang">
						<div class="input_hang">
							<span class="gn_name">驾校&nbsp;:&nbsp;</span>
							<input type="hidden" name="fcontrolunitid" value="${department.fid }">
							<input  type="text" name="drivingSchool"  value="${department.fnameL2}" readonly="readonly" style="color: gray;"/>
						</div>
						<div class="input_hang">
							<span class="gn_name">考试科目&nbsp;:&nbsp;</span>
							<select name="cfkskm"   style="width: 234px;height: 31px"  >
								<option value="科目二"  selected="selected">科目二</option>
                    		</select>					
						</div>					
					</div>
					<div class="div_input_hang">
						<div class="input_hang">
							<span class="gn_name">学员&nbsp;:&nbsp;</span>
							<input  type="text" class="studentName is_click_ne" name="studentName"   value="${subjectTwoNo.studentName }"   onclick="clickName($(this))"/>
							<input  type="hidden" name="cfstudentid"  class="cfstudentid" value="${subjectTwoNo.cfstudentid }"  style="color: gray;"/>
						</div>
						<div class="input_hang">
							<span class="gn_name">准考车型&nbsp;:&nbsp;</span>							
							<select  name="cfzkcx" style="width: 234px;height: 31px">
								<option value="${subjectTwoNo.cfzkcx }">${subjectTwoNo.cfzkcx }</option>
                        		<option value="A1">A1</option>
                        		<option value="A2">A2</option>
                        		<option value="A3">A3</option>
                        		<option value="B1">B1</option>
                        		<option value="B2">B2</option>
                        		<option value="C1" >C1</option>
                        		<option value="C2">C2</option>
                        		<option value="C3">C3</option>
                        		<option value="C4">C4</option>
                        		<option value="D">D</option>
                     	   		<option value="E">E</option>
                        		<option value="F">F</option>
                        		<option value="M">M</option>
                        		<option value="N">N</option>                       	
                        		<option value="P">P</option>
                        	</select>
						</div>						
					</div>
					<div class="div_input_hang">
						<div class="input_hang">
							<span class="gn_name">序号&nbsp;:&nbsp;</span>
							<input  type="text" name="cfxh"  value="${subjectTwoNo.cfxh }"  />
						</div>
						<div class="input_hang">
							<span class="gn_name">约考顺序&nbsp;:&nbsp;</span>
							<input  type="text" name="cfyksx"  value="${subjectTwoNo.cfyksx }"  />
						</div>						
					</div>
					<div class="div_input_hang">
						<div class="input_hang">
							<span class="gn_name">证明号码&nbsp;:&nbsp;</span>
							<input  type="text" name="cfzjhm"  class="cfzjhm" value="${subjectTwoNo.cfzjhm }" />
						</div>
						<div class="input_hang">
							<span class="gn_name">业务类型&nbsp;:&nbsp;</span>
							<input  type="text" name=""  value=""  s/>					
						</div>						
					</div>
					<div class="div_input_hang">
						<div class="input_hang">
							<span class="gn_name">准考证明编号&nbsp;:&nbsp;</span>
							<input  type="text" name="cfzkzmbh"  class="cfzkzbh" value="${subjectTwoNo.cfzkzmbh }"  />
						</div>
						<div class="input_hang">
							<span class="gn_name">考试场次&nbsp;:&nbsp;</span>
							<input  type="text" name="cfkscc"  value="${subjectTwoNo.cfkscc }"  />						
						</div>						
					</div>
					<div class="div_input_hang">
						<div class="input_hang">
							<span class="gn_name">流水号&nbsp;:&nbsp;</span>
							<input  type="text" name="cflsh"  value="${subjectTwoNo.cflsh }"  />
						</div>
						<div class="input_hang">
							<span class="gn_name">考试地点&nbsp;:&nbsp;</span>
							<input  type="text" name="cfksdd"  value="${subjectTwoNo.cfksdd }"  />
						</div>						
					</div>
					<div class="div_input_hang">
						<div class="input_hang">
							<span class="gn_name">约考日期&nbsp;:&nbsp;</span>
							<input type="text" name="cfykrq"  value="${subjectTwoNo.cfykrq }" id="cfykrq"
                               onclick="WdatePicker({el:'cfykrq',dateFmt:'yyyy-MM-dd'})"/>                        	
                        	<img onclick="WdatePicker({el:'cfykrq',dateFmt:'yyyy-MM-dd'})"
                             src="<%=path%>/image/date.jpg" align="absmiddle" style="padding-left: 15px">
						</div>
						<div class="input_hang">
							<span class="gn_name">驾校简称&nbsp;:&nbsp;</span>
							<input  type="text" name="cfjxjc"  value="${subjectTwoNo.cfjxjc }"  />
						</div>						
					</div>
     
                <div class="div_tj">
					<shiro:hasPermission name="/sureSubjectTwoNo">
						<div>
                            <input type="submit" class="input_submit bc" value="">
						</div>
					</shiro:hasPermission>

                    <div>
                        <input type="button" class="input_back fh" value="" onclick="back()"/>
                    </div>
                </div>
                </div>
            </form>
        </div>
    </div>
</div>
</body>
<script type="text/javascript" src="<%=path%>/JQuery/jquery-1.8.2.js"></script>
<%@ include file="/WEB-INF/JSP/ajax.jsp" %>

<script>

var id = "";//学员id
var stuname="";//学员姓名
var idcarno="";//学员身份证
var zkzbh="";//准考证编号

//弹出模式框
function clickName(e) {
    $('#modal-overlay').css('visibility', 'visible')
    $('.modal-data').css('visibility', 'visible')
   	$('input:checkbox').removeAttr('checked');
	$('.page').show();
}
//关闭模式框
  $('.btn').click(function (){
	  $('#modal-overlay').css('visibility', 'hidden')
	  $('.modal-data').css('visibility', 'hidden')
  })

  	//设置只能单选
   $(".xysj td").live('click',function(){
    	$('input:checkbox[name=student]:checked').each(function(i) {
    		$(this).removeAttr("checked");
     	});
     	$(this).parent().find("input:checkbox[name=student]").attr('checked','checked');
	}) 
	//双击确认
	$(document).on('dblclick','.xysj td',function(){		
		id = $(this).parent().find("td").eq("0").children("input:checkbox[name=student]").val()
        stuname=$(this).parent().find("td").eq("1").html()
        idcarno = $(this).parent().find("td").eq("3").html()
        zkzbh = $(this).parent().find("td").eq("45").html()       
        $('.cfstudentid').val(id)
  	    $('.studentName').val(stuname)
  	  	$('.cfzjhm').val(idcarno)
  	  	$('.cfzkzbh').val(zkzbh)
  	  	$('#modal-overlay').css('visibility', 'hidden')
  	  	$('.modal-data').css('visibility', 'hidden')  
	})
  //确定 添加学员信息
  $('.subtn').click(function (){
	  $("input:checkbox[name=student]:checked").each(function(i){	
            id = $(this).val();
            stuname=$(this).parent().parent().find("td").eq("1").html()
            idcarno = $(this).parent().parent().find("td").eq("3").html()
            zkzbh = $(this).parent().parent().find("td").eq("45").html()	 
	  })
	  if(id == ''){
		  alert("请勾选要添加的学员!")
		  return false;
	  }
	  $('.cfstudentid').val(id)
	  $('.studentName').val(stuname)
	  $('.cfzjhm').val(idcarno)
	  $('.cfzkzbh').val(zkzbh)
	  $('#modal-overlay').css('visibility', 'hidden')
	  $('.modal-data').css('visibility', 'hidden')  
	  
  })
  function check(){
	if($("#cfykrq").val() == null || $("#cfykrq").val() == ''){//约考日期不能为空
		alert("约考日期不能为空!")
		$("#cfykrq").focus();
		return false;
	}
      if($(".studentName").val() == null || $(".studentName").val() == ''){
          alert("学员不能为空");
          return false;
      }
      $("input[type='submit']").attr("disabled", "disabled");
  }
  	//返回
	function back(){
        parent.closeSelectCard()

//        location = '<%=path%>/DrivingSys/querySubjectTwoNo/look.action';
	}

</script>
</html>